<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>lesson7_数据表格</title>
		<link rel="stylesheet" href="./layui/css/layui.css">
	</head>
	<body>
		
		<table id="demo" lay-filter="test"></table>
		<!-- 引入js-->
		<script src="./layui/layui.js"></script>
		<!-- 引入表单模块 -->
		<script>
			layui.use(['table','form'],function(){
				var tb = layui.table;
				tb.render({
					elem: '#demo'
					,height: 312
					,url: '/static/json/table/user.json' //数据接口
					,page: true //开启分页
					,cols: [[ //表头
					  {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
					  ,{field: 'username', title: '用户名', width:80}
					  ,{field: 'sex', title: '性别', width:80, sort: true}
					  ,{field: 'city', title: '城市', width:80} 
					  ,{field: 'sign', title: '签名', width: 177}
					  ,{field: 'experience', title: '积分', width: 80, sort: true}
					  ,{field: 'score', title: '评分', width: 80, sort: true}
					  ,{field: 'classify', title: '职业', width: 80}
					  ,{field: 'words', title: '字数', width: 135, sort: true}
					]]
				});
			});
		</script>
	</body>
</html>